// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.blocking.rest.actuator

import com.metest.api.TestServerExtension
import com.metest.api.client.okhttp.MetestOkHttpClient
import com.metest.api.models.rest.actuator.caches.CachDeleteByNameParams
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(TestServerExtension::class)
internal class CachServiceTest {

    @Disabled("Prism tests are disabled")
    @Test
    fun list() {
        val client =
            MetestOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachService = client.rest().actuator().caches()

        val caches = cachService.list()

        caches.validate()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun clear() {
        val client =
            MetestOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachService = client.rest().actuator().caches()

        cachService.clear()
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun deleteByName() {
        val client =
            MetestOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachService = client.rest().actuator().caches()

        cachService.deleteByName(
            CachDeleteByNameParams.builder().cache("cache").cacheManager("cacheManager").build()
        )
    }

    @Disabled("Prism tests are disabled")
    @Test
    fun retrieveByName() {
        val client =
            MetestOkHttpClient.builder()
                .baseUrl(TestServerExtension.BASE_URL)
                .apiKey("My API Key")
                .build()
        val cachService = client.rest().actuator().caches()

        val response =
            cachService.retrieveByName(
                CachRetrieveByNameParams.builder()
                    .cache("cache")
                    .cacheManager("cacheManager")
                    .build()
            )

        response.validate()
    }
}
